﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wicresoft.SMS.Gateway.Host;

namespace SMS.Gateway.Host.Test
{
    /// <summary>
    ///This is a test class for WESMSProviderTest and is intended
    ///to contain all WESMSProviderTest Unit Tests
    ///</summary>
    [TestClass()]
    public class WESMSProviderTest
    {
        private TestContext testContextInstance;

        IWESMSParams testParameters;

        SMSResult smsResultActual;

        //get some test parameters when the test class is generated.
        public WESMSProviderTest(IWESMSParams parameters)
        {
            testParameters = parameters;
        }

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for WESMSProvider Constructor
        ///</summary>
        [TestMethod()]
        public void WESMSProviderConstructorTest()
        {
            IWESMSParams paraments = testParameters; // TODO: Initialize to an appropriate value
            WESMSProvider target = new WESMSProvider(paraments);

            Assert.IsNotNull(target);
            //Assert.Inconclusive("TODO: Implement code to verify target");
        }

        /// <summary>
        ///A test for SendMsg
        ///</summary>
        [TestMethod()]
        public void SendMsgTest()
        {
            IWESMSParams paraments = testParameters; // TODO: Initialize to an appropriate value
            WESMSProvider target = new WESMSProvider(paraments); // TODO: Initialize to an appropriate value
            string moblie = "18964717076"; // TODO: Initialize to an appropriate value
            string content = "WESMSProviderTest.SendMsgTest() is called. Running Time is " + DateTime.Now.ToString(); // TODO: Initialize to an appropriate value
            //SMSResult expected = null; // TODO: Initialize to an appropriate value
            smsResultActual = target.SendMsg(moblie, content);
            
            TestContext.WriteLine("Assert.AreEqual(SendStatus.OK, smsResultActual.Status)");
            Assert.AreEqual(SendStatus.OK, smsResultActual.Status);
        }


        /// <summary>
        ///A test for QueryMsgState
        ///</summary>
        [TestMethod()]
        public void QueryMsgStateTest()
        {
            IWESMSParams paraments = testParameters; // TODO: Initialize to an appropriate value
            WESMSProvider target = new WESMSProvider(paraments); // TODO: Initialize to an appropriate value
            string MassageId = string.Empty; // TODO: Initialize to an appropriate value
            //MsgResult expected = null; // TODO: Initialize to an appropriate value
            MsgResult actual;
            actual = target.QueryMsgState(smsResultActual.MessageId);

            TestContext.WriteLine("Assert.IsNotNull(actual);");
            Assert.IsNotNull(actual);
        }

    }
}
